#define _CRT_SECURE_NO_WARNINGS 1


#include<stdio.h>
#include<string.h>

int fun(char* a, char* b)
{
	while (*a != '\0' && *b != '\0')
	{
		if (*a != *b)
			return (*a - *b);
		a++;
		b++;
	}
}
int main()
{
	char a[101] = { 0 }, b[101] = { 0 };
	scanf("%s %s", a, b);
	if (strcmp(a, b) == 0)
		printf("0\n");
	else
		printf("%d\n", fun(a, b));

	return 0;
}